home *** CD-ROM | disk | FTP | other *** search
- #ifndef __PCX_STREAM__
- #define __PCX_STREAM__
-
- #include <stdio.h>
- #include <Simple.h>
-
- const BUFFER_LENGTH = 1024;
-
- class pcxstream
- {
- public:
- pcxstream(FILE * f);
- bool isValid() { return buffer != 0; }
- void read(unsigned char * dest, int n);
- int pcxstream::get()
- {
- if(pos == BUFFER_LENGTH)
- {
- fread(buffer, 1, BUFFER_LENGTH, file);
- pos = 0;
- }
- return buffer[pos++];
- } // read char
- ~pcxstream();
-
-
- private:
- unsigned char * buffer;
- int pos;
- FILE * file;
- };
- #endif __PCX_STREAM__